{% extends 'base.html' %}
{% load rbac %}

{% block content %}
        <div class="luffy-container">
        <div class="btn-group" style="margin:5px 0">
                <a class="btn btn-default" href="{% url 'rbac:role_add' %}">
                    <i class="fa fa-plus-square" aria-hidden="true"></i> 添加角色
                </a>




        </div>

        <table class="table table-bordered table-hover">
            <thead>
            <tr>
                <th>ID</th>
                <th>名称</th>


{#                {% if request|has_permission:"customer_edit" or request|has_permission:"customer_del" %}#}
                <th>操作</th>
{#                {% endif %}#}
            </tr>
            </thead>
            <tbody>
            {% for row in objects %}
                <tr>
                    <td>{{ row.id }}</td>
                    <td>{{ row.title }}</td>
{#                    <td>{{ row.permissions__Permission }}</td>#}

{#                     {% if request|has_permission:"customer_edit" or request|has_permission:"customer_del" %}#}
                        <td>
{#                            {% if request|has_permission:"customer_edit" %}#}
                                <a style="color:#333333;" href="{% url 'rbac:role_edit' row.id %}">
                                    <i class="fa fa-edit" aria-hidden="true"></i> 编辑
                                </a>
{#                            {%endif%}#}
{#                            {% if request|has_permission:"customer_edit" %}#}
                                <a style="color:#d9534f;" href="{% url 'rbac:role_del' row.id %}">
                                <i class="fa fa-trash-o"></i> 删除
                                </a>
{#                            {% endif %}#}
                        </td>
{#                     {% endif %}#}

                </tr>
            {% endfor %}
            </tbody>
        </table>

    </div>

{% endblock %}